const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: "自增id",
      field: "id"
    },
    goods_id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "商品id",
      field: "goods_id"
    },
    category_id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "分类id",
      field: "category_id"
    },
    add_time: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: true,
      defaultValue: "0",
      primaryKey: false,
      autoIncrement: false,
      comment: "添加时间",
      field: "add_time"
    }
  };
  const options = {
    tableName: "sxo_goods_category_join",
    comment: "",
    indexes: [{
      name: "goods_id",
      unique: false,
      type: "BTREE",
      fields: ["goods_id"]
    }, {
      name: "category_id",
      unique: false,
      type: "BTREE",
      fields: ["category_id"]
    }]
  };
  const SxoGoodsCategoryJoinModel = sequelize.define("sxo_goods_category_join_model", attributes, options);
  return SxoGoodsCategoryJoinModel;
};